﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace P20_3 {
    internal class Program {
        static void Main(string[] args) {
            /**
             *myform：事件的拥有者
             *myform.Click：事件
             *myform：事件响应者
             *FormClicked：事件的具体处理器
             * myform.Click += myform.FormClicked;：事件的订阅
             */
            MyForm myform = new MyForm();
            myform.Click += myform.FormClicked;
            myform.ShowDialog();
        }
    }

    class MyForm : Form {
        internal void FormClicked(object sender, EventArgs e) {
            this.Text = DateTime.Now.ToString();
        }
    }
}
